package com.liangzhong.global
{
	import com.common.stdlib.ArrayUtil;
	
	import flash.utils.ByteArray;

	/**
	 *腾讯应用头 
	 * @author lake
	 */	
	public class TGW_Head
	{
		/**
		 *例子 
		 */		
		private var tempStr :String = "tgw_l7_forward\r\nHost: app12345-54321.qzoneapp.com:8002\r\n\r\n";
		/**
		 * 头
		 */		
		private var hStr 	:String = "tgw_l7_forward\r\nHost:";
		/**
		 * 中间域名信息
		 */		
		public var mStr 	:String = "";
		/**
		 * 结束
		 */		
		private var endStr :String = "\r\n\r\n";
		
		public function TGW_Head()
		{
		}
		
		/**
		 *写入字节数据 
		 * @return 
		 * 
		 */		
		public function toByteArray():ByteArray
		{
			var result:ByteArray = ArrayUtil.newLitteEndianByteArray();
			var info :String = hStr + mStr + endStr;
			result.writeMultiByte(info,"GBK");
			result.position = 0;
			return result;
		}
	}
}